Adding XML overrides

You can configure a flex field to use extra XML definitions such as widgets, table attributes, and measured unit field definitions. For this purpose, you use the Extra XML Definition field in the Edit Metafield form (on page 1). For more detailed information on how to use this form, see Configuring a flex field in N4 (on page 1).

To figure out the XML definition to use, find a similar field and look up the XML definition in the Metafield Diagnostics for UI Tier view by right-clicking the field and selecting Show Diagnostics.

 

N4 does not validate XML code.

Table attributes

The following table attributes control the display of a field value in the column of a list view:

The following code segment shows these attributes in a .dtd fragment:

<!ELEMENT table (attributes?)>

<!ATTLIST table hAlignment (left|center|right) #IMPLIED>

<!ATTLIST table maxFractionalDigits CDATA #IMPLIED>

Measured unit field definitions

You can configure a flex field with a data type of double to be a measured unit of one of the following types:

The following attributes govern the handling of measured fields:

The following code segment shows these attributes in a .dtd fragment:

<!ELEMENT measure (length | volume | mass | temperature ) >

<!ELEMENT length EMPTY>

<!ATTLIST length dataUnit (mm|cm|m|in|ft|yd|dynamic) #REQUIRED >

<!ATTLIST length userUnit (mm|cm|m|in|ft|yd|dynamic) #REQUIRED >

<!ELEMENT temperature EMPTY>

<!ATTLIST temperature dataUnit (F|C|dynamic) #REQUIRED >

<!ATTLIST temperature userUnit (F|C|dynamic) #REQUIRED >

<!ELEMENT mass EMPTY> <!-- fully supported-->

<!ATTLIST mass dataUnit (g|kg|lb|quintals|long-ton|short-ton|tonne|dynamic) #REQUIRED >

<!ATTLIST mass userUnit (g|kg|lb|quintals|long-ton|short-ton|tonne|dynamic) #REQUIRED >

In the following example, the XML definition allows this dynamic field to be used as a temperature widget. This is the code you would enter in the Extra XML Definition field in the Edit Metafield form.

<metafield id="eqtypCustomDFFDouble2>

<measure>

   <temperature dataUnit="C" userUnit="F" />

</measure>

<table maxFractionalDigits="1" />

</metafield>

The following figure illustrates how the field behaves in the user interface:

It is more likely, however, that you store and display in the same measured unit.